localhost 8080 was
$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml The connection to the server localhost:8080 was refused - did you specify the right host or port?
出现了上面的错误,解决方案:1.6.1 The connection to the server localhost:8080 was refused
$ sudo cp /etc/kubernetes/admin.conf $HOME/ $ sudo chown $(id -u):$(id -g) $HOME/admin.conf $ export KUBECONFIG=$HOME/admin.conf
其实上面的解决方式,在初始化集群的打印信息里面就有,要求我们设置环境变量KUBECONFIG为配置文件的路径,以便后续的使用。